﻿// IniParser.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include "../src/IniParser.h"

static const std::string FILE_PATH = "../test/test.ini";

static const std::string SECTION_TEST = "SECTION";

static const std::string KEY_NAME = "name";
static const std::string KEY_AGE = "age";
static const std::string DEF_VAL = "def";

int main()
{
    CIniParser iniObj(FILE_PATH);
    auto name = iniObj.GetString(SECTION_TEST, KEY_NAME, DEF_VAL);
    auto age = iniObj.GetInteger(SECTION_TEST, KEY_AGE, 10);

    iniObj.SetInteger(SECTION_TEST, KEY_AGE, 18);
    age = iniObj.GetInteger(SECTION_TEST, KEY_AGE, 0);

    iniObj.SetInteger(SECTION_TEST, "aaa", 18);

    iniObj.SetInteger("SECTION_TEST", "aaa", 13);

    iniObj.SetInteger(SECTION_TEST, "ccc", 50);

    iniObj.Save();

    return 0;
}


